
function printContent(printScopeId,cssFile){
    var printContent=document.getElementById(printScopeId).innerHTML;
    
    //1. Add style
    var htmContent= "<html><head>";
    htmContent= htmContent+"<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>";
    htmContent= htmContent+"<meta http-equiv='X-UA-Compatible' content='IE=8'/>";
    htmContent= htmContent+"<link rel='stylesheet' type='text/css' media='print' href='"+cssFile+"'></link>";
    htmContent= htmContent+"<link rel='stylesheet' type='text/css' media='screen' href='"+cssFile+"'></link>";
    
    //2. Add content
    htmContent = htmContent+ "</head><body>" + printContent + "</body></html>";
    
    var pwin=window.open("print.htm","print");    
    pwin.document.write(htmContent);    
    pwin.document.close();
    pwin.print();
    pwin.close();
}